package streamforce.crypto.user;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;
import java.util.Properties;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import streamforce.crypto.event.TransformedCTEventAll;
import streamforce.crypto.event.UserInitAggEvent;
import streamforce.crypto.event.UserInitEvent;
import streamforce.crypto.message.PolicyMessage;
import streamforce.crypto.message.UserHandshakeMessage;
import streamforce.crypto.policies.Policy;
import streamforce.crypto.user.subscriber.UserSelectAllSimple;
import streamforce.crypto.user.subscriber.UserSelectPriceSimple;
import streamforce.crypto.user.subscriber.UserSumAllAgg1;
import streamforce.crypto.user.subscriber.UserSumPriceAgg1;

/**
 * Connecting to the server.
 * 
 * It only has to listen to new messages: initilization and
 * then decryption
 *
 */
public class EPUserClientAgg2 extends EPUserClientSimple{
		
	public EPUserClientAgg2(int ui, int type){
		super(ui,type); 	
		int[] ids = {this.userId};
		this.uhm = new UserHandshakeMessage(ids,PolicyMessage.AGG_QUERY_2);
	}			
		
	public static void main(String[] args){
		int id = new Integer(args[0]).intValue();
		(new EPUserClientAgg2(id,EPUserClientAgg2.SELECT_ALL)).start();
	}
}
